package student.convert

import org.apache.flink.streaming.api.scala._

object SocketTextStream {
  def main(args: Array[String]): Unit = {
    val env = StreamExecutionEnvironment.getExecutionEnvironment
    env
      .socketTextStream("192.168.220.131",666)
      .flatMap(_.split(" "))
      .map((_,1))
      .keyBy(_._1)
      .sum(1)
      .print()
    env.execute()
  }
}
